import json

# Time: 2020/08/09 22:01 Finish
# Author: Jamie793/Jamiexu
# Site: https://blog.jamiexu.cn
# Email: doxm@foxmail.com
# The coding api from BaiDuWenKuApi,Jamie793/Jamiexu analysis and writed

types = '''{
  "data": [
    {
      "pcid": 0,
      "cid": 1,
      "name": "教育专区",
      "list": [
        {
          "pcid": 1,
          "cid": 17,
          "name": "幼儿教育",
          "list": [
            {
              "pcid": 17,
              "cid": 13,
              "name": "幼儿读物"
            },
            {
              "pcid": 17,
              "cid": 14,
              "name": "少儿英语"
            },
            {
              "pcid": 17,
              "cid": 15,
              "name": "唐诗宋词"
            },
            {
              "pcid": 17,
              "cid": 16,
              "name": "育儿理论经验"
            },
            {
              "pcid": 17,
              "cid": 647,
              "name": "育儿知识"
            },
            {
              "pcid": 17,
              "cid": 648,
              "name": "家庭教育"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 8,
          "name": "小学教育",
          "list": [
            {
              "pcid": 8,
              "cid": 18,
              "name": "语文",
              "list": [
                {
                  "pcid": 18,
                  "cid": 504,
                  "name": "六年级语文"
                },
                {
                  "pcid": 18,
                  "cid": 561,
                  "name": "一年级语文"
                },
                {
                  "pcid": 18,
                  "cid": 565,
                  "name": "二年级语文"
                },
                {
                  "pcid": 18,
                  "cid": 569,
                  "name": "三年级语文"
                },
                {
                  "pcid": 18,
                  "cid": 573,
                  "name": "四年级语文"
                },
                {
                  "pcid": 18,
                  "cid": 577,
                  "name": "五年级语文"
                }
              ]
            },
            {
              "pcid": 8,
              "cid": 19,
              "name": "数学",
              "list": [
                {
                  "pcid": 19,
                  "cid": 505,
                  "name": "六年级数学"
                },
                {
                  "pcid": 19,
                  "cid": 562,
                  "name": "一年级数学"
                },
                {
                  "pcid": 19,
                  "cid": 566,
                  "name": "二年级数学"
                },
                {
                  "pcid": 19,
                  "cid": 570,
                  "name": "三年级数学"
                },
                {
                  "pcid": 19,
                  "cid": 574,
                  "name": "四年级数学"
                },
                {
                  "pcid": 19,
                  "cid": 578,
                  "name": "五年级数学"
                }
              ]
            },
            {
              "pcid": 8,
              "cid": 20,
              "name": "英语",
              "list": [
                {
                  "pcid": 20,
                  "cid": 506,
                  "name": "六年级英语"
                },
                {
                  "pcid": 20,
                  "cid": 563,
                  "name": "一年级英语"
                },
                {
                  "pcid": 20,
                  "cid": 567,
                  "name": "二年级英语"
                },
                {
                  "pcid": 20,
                  "cid": 571,
                  "name": "三年级英语"
                },
                {
                  "pcid": 20,
                  "cid": 575,
                  "name": "四年级英语"
                },
                {
                  "pcid": 20,
                  "cid": 579,
                  "name": "五年级英语"
                }
              ]
            },
            {
              "pcid": 8,
              "cid": 21,
              "name": "其它课程",
              "list": [
                {
                  "pcid": 21,
                  "cid": 508,
                  "name": "六年级其它课程"
                },
                {
                  "pcid": 21,
                  "cid": 564,
                  "name": "一年级其它课程"
                },
                {
                  "pcid": 21,
                  "cid": 568,
                  "name": "二年级其它课程"
                },
                {
                  "pcid": 21,
                  "cid": 572,
                  "name": "三年级其它课程"
                },
                {
                  "pcid": 21,
                  "cid": 576,
                  "name": "四年级其它课程"
                },
                {
                  "pcid": 21,
                  "cid": 580,
                  "name": "五年级其它课程"
                }
              ]
            },
            {
              "pcid": 8,
              "cid": 22,
              "name": "学科竞赛"
            },
            {
              "pcid": 8,
              "cid": 100,
              "name": "小学作文"
            },
            {
              "pcid": 8,
              "cid": 630,
              "name": "小升初",
              "list": [
                {
                  "pcid": 630,
                  "cid": 631,
                  "name": "简历"
                },
                {
                  "pcid": 630,
                  "cid": 632,
                  "name": "面试题"
                },
                {
                  "pcid": 630,
                  "cid": 633,
                  "name": "数学"
                },
                {
                  "pcid": 630,
                  "cid": 634,
                  "name": "语文"
                },
                {
                  "pcid": 630,
                  "cid": 635,
                  "name": "英语"
                },
                {
                  "pcid": 630,
                  "cid": 636,
                  "name": "其它课程"
                },
                {
                  "pcid": 630,
                  "cid": 637,
                  "name": "重点中学资料"
                }
              ]
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 9,
          "name": "初中教育",
          "list": [
            {
              "pcid": 9,
              "cid": 23,
              "name": "语文",
              "list": [
                {
                  "pcid": 23,
                  "cid": 509,
                  "name": "初三语文"
                },
                {
                  "pcid": 23,
                  "cid": 581,
                  "name": "初一语文"
                },
                {
                  "pcid": 23,
                  "cid": 586,
                  "name": "初二语文"
                }
              ]
            },
            {
              "pcid": 9,
              "cid": 24,
              "name": "数学",
              "list": [
                {
                  "pcid": 24,
                  "cid": 510,
                  "name": "初三数学"
                },
                {
                  "pcid": 24,
                  "cid": 582,
                  "name": "初一数学"
                },
                {
                  "pcid": 24,
                  "cid": 587,
                  "name": "初二数学"
                }
              ]
            },
            {
              "pcid": 9,
              "cid": 25,
              "name": "英语",
              "list": [
                {
                  "pcid": 25,
                  "cid": 511,
                  "name": "初三英语"
                },
                {
                  "pcid": 25,
                  "cid": 583,
                  "name": "初一英语"
                },
                {
                  "pcid": 25,
                  "cid": 588,
                  "name": "初二英语"
                }
              ]
            },
            {
              "pcid": 9,
              "cid": 26,
              "name": "政史地",
              "list": [
                {
                  "pcid": 26,
                  "cid": 513,
                  "name": "初三政史地"
                },
                {
                  "pcid": 26,
                  "cid": 585,
                  "name": "初一政史地"
                },
                {
                  "pcid": 26,
                  "cid": 590,
                  "name": "初二政史地"
                }
              ]
            },
            {
              "pcid": 9,
              "cid": 27,
              "name": "理化生",
              "list": [
                {
                  "pcid": 27,
                  "cid": 512,
                  "name": "初三理化生"
                },
                {
                  "pcid": 27,
                  "cid": 584,
                  "name": "初一理化生"
                },
                {
                  "pcid": 27,
                  "cid": 589,
                  "name": "初二理化生"
                }
              ]
            },
            {
              "pcid": 9,
              "cid": 28,
              "name": "科学"
            },
            {
              "pcid": 9,
              "cid": 29,
              "name": "学科竞赛"
            },
            {
              "pcid": 9,
              "cid": 30,
              "name": "其它课程"
            },
            {
              "pcid": 9,
              "cid": 103,
              "name": "中考"
            },
            {
              "pcid": 9,
              "cid": 107,
              "name": "初中作文"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 31,
          "name": "高中教育",
          "list": [
            {
              "pcid": 31,
              "cid": 32,
              "name": "语文",
              "list": [
                {
                  "pcid": 32,
                  "cid": 516,
                  "name": "高三语文"
                },
                {
                  "pcid": 32,
                  "cid": 596,
                  "name": "高一语文"
                },
                {
                  "pcid": 32,
                  "cid": 601,
                  "name": "高二语文"
                }
              ]
            },
            {
              "pcid": 31,
              "cid": 33,
              "name": "数学",
              "list": [
                {
                  "pcid": 33,
                  "cid": 517,
                  "name": "高三数学"
                },
                {
                  "pcid": 33,
                  "cid": 597,
                  "name": "高一数学"
                },
                {
                  "pcid": 33,
                  "cid": 602,
                  "name": "高二数学"
                }
              ]
            },
            {
              "pcid": 31,
              "cid": 34,
              "name": "英语",
              "list": [
                {
                  "pcid": 34,
                  "cid": 518,
                  "name": "高三英语"
                },
                {
                  "pcid": 34,
                  "cid": 598,
                  "name": "高一英语"
                },
                {
                  "pcid": 34,
                  "cid": 603,
                  "name": "高二英语"
                }
              ]
            },
            {
              "pcid": 31,
              "cid": 35,
              "name": "政史地",
              "list": [
                {
                  "pcid": 35,
                  "cid": 600,
                  "name": "高一政史地"
                },
                {
                  "pcid": 35,
                  "cid": 605,
                  "name": "高二政史地"
                },
                {
                  "pcid": 35,
                  "cid": 607,
                  "name": "高三政史地"
                }
              ]
            },
            {
              "pcid": 31,
              "cid": 36,
              "name": "理化生",
              "list": [
                {
                  "pcid": 36,
                  "cid": 599,
                  "name": "高一理化生"
                },
                {
                  "pcid": 36,
                  "cid": 604,
                  "name": "高二理化生"
                },
                {
                  "pcid": 36,
                  "cid": 606,
                  "name": "高三理化生"
                }
              ]
            },
            {
              "pcid": 31,
              "cid": 37,
              "name": "高中作文"
            },
            {
              "pcid": 31,
              "cid": 38,
              "name": "学科竞赛"
            },
            {
              "pcid": 31,
              "cid": 39,
              "name": "其它课程"
            },
            {
              "pcid": 31,
              "cid": 106,
              "name": "高考"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 10,
          "name": "高等教育",
          "list": [
            {
              "pcid": 10,
              "cid": 40,
              "name": "军事"
            },
            {
              "pcid": 10,
              "cid": 41,
              "name": "艺术"
            },
            {
              "pcid": 10,
              "cid": 42,
              "name": "院校资料"
            },
            {
              "pcid": 10,
              "cid": 43,
              "name": "其它"
            },
            {
              "pcid": 10,
              "cid": 56,
              "name": "研究生入学考试"
            },
            {
              "pcid": 10,
              "cid": 108,
              "name": "理学"
            },
            {
              "pcid": 10,
              "cid": 109,
              "name": "工学"
            },
            {
              "pcid": 10,
              "cid": 110,
              "name": "农学"
            },
            {
              "pcid": 10,
              "cid": 111,
              "name": "医学"
            },
            {
              "pcid": 10,
              "cid": 112,
              "name": "文学"
            },
            {
              "pcid": 10,
              "cid": 113,
              "name": "管理学"
            },
            {
              "pcid": 10,
              "cid": 114,
              "name": "经济学"
            },
            {
              "pcid": 10,
              "cid": 115,
              "name": "哲学"
            },
            {
              "pcid": 10,
              "cid": 116,
              "name": "历史学"
            },
            {
              "pcid": 10,
              "cid": 117,
              "name": "法学"
            },
            {
              "pcid": 10,
              "cid": 118,
              "name": "教育学"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 47,
          "name": "教学研究",
          "list": [
            {
              "pcid": 47,
              "cid": 48,
              "name": "教学案例/设计"
            },
            {
              "pcid": 47,
              "cid": 49,
              "name": "教学计划"
            },
            {
              "pcid": 47,
              "cid": 50,
              "name": "教学反思/汇报"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 11,
          "name": "外语学习",
          "list": [
            {
              "pcid": 11,
              "cid": 44,
              "name": "韩语学习"
            },
            {
              "pcid": 11,
              "cid": 57,
              "name": "英语考试"
            },
            {
              "pcid": 11,
              "cid": 119,
              "name": "英语学习"
            },
            {
              "pcid": 11,
              "cid": 120,
              "name": "日语学习"
            },
            {
              "pcid": 11,
              "cid": 121,
              "name": "法语学习"
            },
            {
              "pcid": 11,
              "cid": 122,
              "name": "其它语言学习"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 2,
          "name": "资格考试/认证",
          "list": [
            {
              "pcid": 2,
              "cid": 45,
              "name": "从业资格考试"
            },
            {
              "pcid": 2,
              "cid": 46,
              "name": "交规考试"
            },
            {
              "pcid": 2,
              "cid": 58,
              "name": "司法考试"
            },
            {
              "pcid": 2,
              "cid": 59,
              "name": "公务员考试"
            },
            {
              "pcid": 2,
              "cid": 60,
              "name": "IT认证"
            },
            {
              "pcid": 2,
              "cid": 61,
              "name": "财会/金融考试"
            },
            {
              "pcid": 2,
              "cid": 62,
              "name": "其它考试"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 628,
          "name": "成人教育",
          "list": [
            {
              "pcid": 628,
              "cid": 638,
              "name": "成考"
            },
            {
              "pcid": 628,
              "cid": 639,
              "name": "自考"
            },
            {
              "pcid": 628,
              "cid": 640,
              "name": "专升本"
            },
            {
              "pcid": 628,
              "cid": 641,
              "name": "电大"
            },
            {
              "pcid": 628,
              "cid": 642,
              "name": "远程、网络教育"
            }
          ]
        },
        {
          "pcid": 1,
          "cid": 629,
          "name": "职业教育",
          "list": [
            {
              "pcid": 629,
              "cid": 643,
              "name": "中职中专"
            },
            {
              "pcid": 629,
              "cid": 644,
              "name": "职高对口"
            },
            {
              "pcid": 629,
              "cid": 645,
              "name": "职业技术培训"
            },
            {
              "pcid": 629,
              "cid": 646,
              "name": "其它"
            }
          ]
        }
      ]
    },
    {
      "pcid": 0,
      "cid": 3,
      "name": "专业资料",
      "list": [
        {
          "pcid": 3,
          "cid": 63,
          "name": "IT/计算机",
          "list": [
            {
              "pcid": 63,
              "cid": 160,
              "name": "电脑基础知识"
            },
            {
              "pcid": 63,
              "cid": 161,
              "name": "计算机软件及应用"
            },
            {
              "pcid": 63,
              "cid": 162,
              "name": "计算机硬件及网络"
            },
            {
              "pcid": 63,
              "cid": 197,
              "name": "互联网"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 64,
          "name": "经管营销",
          "list": [
            {
              "pcid": 64,
              "cid": 146,
              "name": "经济/市场"
            },
            {
              "pcid": 64,
              "cid": 147,
              "name": "金融/投资"
            },
            {
              "pcid": 64,
              "cid": 148,
              "name": "人力资源管理"
            },
            {
              "pcid": 64,
              "cid": 149,
              "name": "财务管理"
            },
            {
              "pcid": 64,
              "cid": 150,
              "name": "生产/经营管理"
            },
            {
              "pcid": 64,
              "cid": 151,
              "name": "企业管理"
            },
            {
              "pcid": 64,
              "cid": 152,
              "name": "公共/行政管理"
            },
            {
              "pcid": 64,
              "cid": 153,
              "name": "销售/营销"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 66,
          "name": "医药卫生",
          "list": [
            {
              "pcid": 66,
              "cid": 167,
              "name": "基础医学"
            },
            {
              "pcid": 66,
              "cid": 168,
              "name": "预防医学"
            },
            {
              "pcid": 66,
              "cid": 169,
              "name": "中医中药"
            },
            {
              "pcid": 66,
              "cid": 170,
              "name": "药学"
            },
            {
              "pcid": 66,
              "cid": 199,
              "name": "临床医学"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 68,
          "name": "自然科学",
          "list": [
            {
              "pcid": 68,
              "cid": 163,
              "name": "物理"
            },
            {
              "pcid": 68,
              "cid": 164,
              "name": "化学"
            },
            {
              "pcid": 68,
              "cid": 165,
              "name": "生物学"
            },
            {
              "pcid": 68,
              "cid": 166,
              "name": "天文/地理"
            },
            {
              "pcid": 68,
              "cid": 198,
              "name": "数学"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 92,
          "name": "农林牧渔",
          "list": [
            {
              "pcid": 92,
              "cid": 171,
              "name": "林学"
            },
            {
              "pcid": 92,
              "cid": 172,
              "name": "畜牧兽医"
            },
            {
              "pcid": 92,
              "cid": 173,
              "name": "水产渔业"
            },
            {
              "pcid": 92,
              "cid": 200,
              "name": "农学"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 175,
          "name": "人文社科",
          "list": [
            {
              "pcid": 175,
              "cid": 65,
              "name": "法律资料"
            },
            {
              "pcid": 175,
              "cid": 67,
              "name": "哲学/历史"
            },
            {
              "pcid": 175,
              "cid": 86,
              "name": "文学研究"
            },
            {
              "pcid": 175,
              "cid": 124,
              "name": "广告/传媒"
            },
            {
              "pcid": 175,
              "cid": 125,
              "name": "教育学/心理学"
            },
            {
              "pcid": 175,
              "cid": 142,
              "name": "军事/政治"
            },
            {
              "pcid": 175,
              "cid": 143,
              "name": "设计/艺术"
            },
            {
              "pcid": 175,
              "cid": 144,
              "name": "社会学"
            },
            {
              "pcid": 175,
              "cid": 145,
              "name": "文化/宗教"
            }
          ]
        },
        {
          "pcid": 3,
          "cid": 230,
          "name": "工程科技",
          "list": [
            {
              "pcid": 230,
              "cid": 87,
              "name": "能源/化工"
            },
            {
              "pcid": 230,
              "cid": 88,
              "name": "信息与通信"
            },
            {
              "pcid": 230,
              "cid": 89,
              "name": "建筑/土木"
            },
            {
              "pcid": 230,
              "cid": 90,
              "name": "机械/仪表"
            },
            {
              "pcid": 230,
              "cid": 91,
              "name": "电力/水利"
            },
            {
              "pcid": 230,
              "cid": 123,
              "name": "交通运输"
            },
            {
              "pcid": 230,
              "cid": 154,
              "name": "电子/电路"
            },
            {
              "pcid": 230,
              "cid": 155,
              "name": "城乡/园林规划"
            },
            {
              "pcid": 230,
              "cid": 156,
              "name": "环境科学/食品科学"
            },
            {
              "pcid": 230,
              "cid": 157,
              "name": "冶金/矿山/地质"
            },
            {
              "pcid": 230,
              "cid": 158,
              "name": "材料科学"
            },
            {
              "pcid": 230,
              "cid": 159,
              "name": "兵器/核科学"
            },
            {
              "pcid": 230,
              "cid": 204,
              "name": "纺织/轻工业"
            }
          ]
        }
      ]
    },
    {
      "pcid": 0,
      "cid": 4,
      "name": "实用文档",
      "list": [
        {
          "pcid": 4,
          "cid": 126,
          "name": "PPT模板",
          "list": [
            {
              "pcid": 126,
              "cid": 211,
              "name": "商务科技"
            },
            {
              "pcid": 126,
              "cid": 212,
              "name": "简洁抽象"
            },
            {
              "pcid": 126,
              "cid": 213,
              "name": "艺术创意"
            },
            {
              "pcid": 126,
              "cid": 214,
              "name": "可爱清新"
            },
            {
              "pcid": 126,
              "cid": 215,
              "name": "节日庆典"
            },
            {
              "pcid": 126,
              "cid": 216,
              "name": "卡通动漫"
            },
            {
              "pcid": 126,
              "cid": 217,
              "name": "自然景观"
            },
            {
              "pcid": 126,
              "cid": 218,
              "name": "动物植物"
            },
            {
              "pcid": 126,
              "cid": 219,
              "name": "中国风"
            },
            {
              "pcid": 126,
              "cid": 220,
              "name": "国外设计风格"
            },
            {
              "pcid": 126,
              "cid": 221,
              "name": "动态背景"
            },
            {
              "pcid": 126,
              "cid": 222,
              "name": "图表模板"
            },
            {
              "pcid": 126,
              "cid": 223,
              "name": "其它模板"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 224,
          "name": "PPT制作技巧",
          "list": [
            {
              "pcid": 224,
              "cid": 225,
              "name": "图片/文字技巧"
            },
            {
              "pcid": 224,
              "cid": 226,
              "name": "动画/交互技巧"
            },
            {
              "pcid": 224,
              "cid": 227,
              "name": "音频/视频技巧"
            },
            {
              "pcid": 224,
              "cid": 228,
              "name": "其它技巧"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 71,
          "name": "求职/职场",
          "list": [
            {
              "pcid": 71,
              "cid": 176,
              "name": "简历"
            },
            {
              "pcid": 71,
              "cid": 177,
              "name": "面试"
            },
            {
              "pcid": 71,
              "cid": 178,
              "name": "职业规划"
            },
            {
              "pcid": 71,
              "cid": 179,
              "name": "自我管理与提升"
            },
            {
              "pcid": 71,
              "cid": 649,
              "name": "笔试"
            },
            {
              "pcid": 71,
              "cid": 650,
              "name": "社交礼仪"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 76,
          "name": "计划/解决方案",
          "list": [
            {
              "pcid": 76,
              "cid": 180,
              "name": "学习计划"
            },
            {
              "pcid": 76,
              "cid": 181,
              "name": "工作计划"
            },
            {
              "pcid": 76,
              "cid": 182,
              "name": "商业计划"
            },
            {
              "pcid": 76,
              "cid": 183,
              "name": "营销/活动策划"
            },
            {
              "pcid": 76,
              "cid": 184,
              "name": "解决方案"
            },
            {
              "pcid": 76,
              "cid": 185,
              "name": "其它"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 77,
          "name": "总结/汇报",
          "list": [
            {
              "pcid": 77,
              "cid": 186,
              "name": "学习总结"
            },
            {
              "pcid": 77,
              "cid": 187,
              "name": "实习总结"
            },
            {
              "pcid": 77,
              "cid": 188,
              "name": "工作总结/汇报"
            },
            {
              "pcid": 77,
              "cid": 189,
              "name": "其它"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 73,
          "name": "党团工作",
          "list": [
            {
              "pcid": 73,
              "cid": 190,
              "name": "入党/转正申请"
            },
            {
              "pcid": 73,
              "cid": 191,
              "name": "思想汇报/心得体会"
            },
            {
              "pcid": 73,
              "cid": 192,
              "name": "党团建设"
            },
            {
              "pcid": 73,
              "cid": 193,
              "name": "其它"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 229,
          "name": "工作范文",
          "list": [
            {
              "pcid": 229,
              "cid": 72,
              "name": "行政公文"
            },
            {
              "pcid": 229,
              "cid": 74,
              "name": "演讲/主持"
            },
            {
              "pcid": 229,
              "cid": 195,
              "name": "制度/规范"
            },
            {
              "pcid": 229,
              "cid": 196,
              "name": "其它"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 203,
          "name": "表格/模板",
          "list": [
            {
              "pcid": 203,
              "cid": 75,
              "name": "合同协议"
            },
            {
              "pcid": 203,
              "cid": 78,
              "name": "调查/报告"
            },
            {
              "pcid": 203,
              "cid": 201,
              "name": "书信模板"
            },
            {
              "pcid": 203,
              "cid": 202,
              "name": "表格类模板"
            }
          ]
        },
        {
          "pcid": 4,
          "cid": 651,
          "name": "法律文书",
          "list": [
            {
              "pcid": 651,
              "cid": 652,
              "name": "调解书"
            },
            {
              "pcid": 651,
              "cid": 653,
              "name": "判决书"
            },
            {
              "pcid": 651,
              "cid": 654,
              "name": "起诉状"
            },
            {
              "pcid": 651,
              "cid": 655,
              "name": "辩护词"
            }
          ]
        }
      ]
    },
    {
      "pcid": 0,
      "cid": 5,
      "name": "生活休闲",
      "list": [
        {
          "pcid": 5,
          "cid": 656,
          "name": "饮食"
        },
        {
          "pcid": 5,
          "cid": 657,
          "name": "游戏"
        },
        {
          "pcid": 5,
          "cid": 658,
          "name": "体育/运动"
        },
        {
          "pcid": 5,
          "cid": 659,
          "name": "音乐"
        },
        {
          "pcid": 5,
          "cid": 660,
          "name": "旅游购物"
        },
        {
          "pcid": 5,
          "cid": 661,
          "name": "娱乐时尚"
        },
        {
          "pcid": 5,
          "cid": 662,
          "name": "美容化妆"
        },
        {
          "pcid": 5,
          "cid": 663,
          "name": "家具家电"
        },
        {
          "pcid": 5,
          "cid": 664,
          "name": "社会民生"
        },
        {
          "pcid": 5,
          "cid": 665,
          "name": "影视/动漫"
        },
        {
          "pcid": 5,
          "cid": 666,
          "name": "保健养生"
        },
        {
          "pcid": 5,
          "cid": 667,
          "name": "随笔"
        },
        {
          "pcid": 5,
          "cid": 668,
          "name": "摄影摄像"
        },
        {
          "pcid": 5,
          "cid": 669,
          "name": "幽默滑稽"
        }
      ]
    }
  ]
}'''


class TypeType:
    def __init__(self, pcid, cid, name, list=None):
        self.pcid = pcid
        self.cid = cid
        self.name = name
        self.list = list

    def getPcid(self):
        return self.pcid

    def getCid(self):
        return self.cid

    def getName(self):
        return self.name

    def getList(self):
        return self.list


def getTagType():
    jsonType = json.loads(types)
    data = jsonType['data']
    type1 = []
    type2 = []
    type3 = []
    type4 = []
    for i in data:
        typeType = TypeType(i['pcid'], i['cid'], i['name'], i['list'] if (i.__contains__('list')) else None)
        type1.append(typeType)
        for j in i['list']:
            typeType = TypeType(j['pcid'], j['cid'], j['name'], j['list'] if (j.__contains__('list')) else None)
            type2.append(typeType)
            if not j.__contains__('list'):
                continue
            for k in j['list']:
                typeType = TypeType(k['pcid'], k['cid'], k['name'], k['list'] if (k.__contains__('list')) else None)
                type3.append(typeType)
                if not k.__contains__('list'):
                    continue
                for l in k['list']:
                    typeType = TypeType(l['pcid'], l['cid'], l['name'], l['list'] if (l.__contains__('list')) else None)
                    type4.append(typeType)

    return type1, type2, type3, type4


if __name__ == '__main__':
    print(getTagType()[0][1].getName())